<!doctype html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="${base}/scripts/jquery.min.js"></script>
    <script src="${base}/scripts/semantic.min.js"></script>
    <link rel="stylesheet" href="${base}/styles/semantic.min.css">

    <title>发布主题</title>
</head>
<body>

<div class="ui grid">
    <div class="centered four wides column">
        <form method="post" action="/topic/save" class="ui fluid form" id="topic-form">
            <div class="field">
                <label>主题名称</label>
                <input type="text" name="title" placeholder="请输入主题名称" autocomplete="off">
                <input type="hidden" name="category_id" value="1">

            </div>
            <textarea name="content" style="width:700px; height:250px; "></textarea>
            <div class="ui error message"></div>
            <input type="submit" value="发布" class="ui fluid primary blue button" >

        </form>
    </div>
</div>

</body>

<script>
    $('#topic-form')
            .form({
                fields: {
                    name: {
                        rules: [
                            {
                                type: 'empty',
                                prompt: '主题名称不能为空'
                            }
                        ]
                    }
                }
            });


</script>
</html>

